<?php
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'login';
model('jy_weishop/member')->checklogin();
//注册电商客会员
$member=model('core/member')->detail($_SESSION['uid'],array('credit1','credit2','mobile','avatar','nickname'));
$storeid=pdo_getcolumn('jy_weishop_member',array('mid'=>$_SESSION['uid'],'uniacid'=>$_SESSION['uniacid']),'storeid');
$api_sid=pdo_getcolumn('jy_weishop_store',array('uniacid'=>$_SESSION['uniacid'],'id'=>$storeid),'api_sid');
if(!$api_sid){
	$api_sid=pdo_getcolumn('jy_weishop_store',array('uniacid'=>$_SESSION['uniacid']),'api_sid');
}
$return['item']=$this->plugin_setting('basic');
if(!$member['mobile']){
	exi('请先绑定手机！','error');
}
if($_RQ['op']=='login'){
	$post=array(
		'sCode'=>$api_sid,
		'mCode'=>$member['mobile'],
	);
	$this->model('model')->api_request($return['item']['loginurl'],$post);
	exi($return);
}
if($_RQ['op']=='card'){
	$post=array(
		'sCode'=>$api_sid,
		'mCode'=>$member['mobile'],
	);
	$this->model('model')->api_request($return['item']['cardurl'],$post);
	exi($return);
}
/*******basic*******/
/*******op*******/
